import 'package:flutter/material.dart';
import '../routes.dart';

class PageContent extends StatelessWidget {
  final String name;

  const PageContent({Key? key, required this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('当前页面：$name'),),
      body: ListView(
        children: [
          // ignore: deprecated_member_use
          FlatButton(
            onPressed: () { 
              Navigator.pushNamed(context, Routes.home);
            },
            child: Text(Routes.home),
          ),
          // ignore: deprecated_member_use
          FlatButton(
            onPressed: () { 
              Navigator.pushNamed(context, Routes.login);
            },
            child: Text(Routes.login),
          ),
          // ignore: deprecated_member_use
          FlatButton(
            onPressed: () { 
              Navigator.pushNamed(context, '/aaaa');
            },
            child: Text('不存在'),
          ),
          // ignore: deprecated_member_use
          FlatButton(
            onPressed: () { 
              Navigator.pushNamed(context, '/room/3333');
            },
            child: Text('房屋详情页。ID：3333'),
          )
        ],
      ),
    );
  }
}